var Docs = function(){
    var layout, center;
    
    var classClicked = function(e, target){
        Docs.loadDoc(target.href);
    };
    
    return {
        init : function(){
            Ext.get('loading').remove();
            
            Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
            
            layout = new Ext.BorderLayout(document.body, {
             
                west: {
                    split:true,
                    initialSize: 177,
                    minSize: 177,
                    maxSize: 177,
                    titlebar: true,
                    collapsible: true,
                    animate: true,
                    showPin: true,
                    useShim:true,
                    cmargins: {top:2,bottom:2,right:2,left:2}
                },
                center: {
                    titlebar: true,
                    title: '',
                    autoScroll:false,
                    tabPosition: 'top',
                    closeOnTab: true,
                    resizeTabs: true
                }
              
            });

            
            layout.beginUpdate();
            
            layout.add('west', new Ext.ContentPanel('menu', {title: '', fitToFrame:true}));
            center = layout.getRegion('center');
            center.add(new Ext.ContentPanel('main', {fitToFrame:true}));
            
            layout.restoreState();
            layout.endUpdate();
            
            var page = '/elbs/app/jsp/home/Main.jsp';
            var menus = '/elbs/app/jsp/home/Menu.jsp';
            this.loadDoc(page);
            this.loadMenu(menus);
        },
        
        loadDoc : function(url){
            Ext.get('main').dom.src = url;
        }
        ,
        loadMenu : function(url){
            Ext.get('menus').dom.src = url;
        }
    };
}();
Ext.onReady(Docs.init, Docs, true);